﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectItem.aspx.cs" Inherits="logicunivesityinventorystore.SelectItem" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script runat="server">

    protected void showModalPopupServerOperatorButton_Click(object sender, EventArgs e)
    {
        //this.programmaticModalPopup.Show();
    }
    protected void hideModalPopupViaServer_Click(object sender, EventArgs e)
    {
       // this.programmaticModalPopup.Hide();
    }
</script>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
     <ajaxToolkit:ToolkitScriptManager runat="Server" ID="ScriptManager1" />
    <script type="text/javascript">
        var styleToSelect;
        function onOk() {
            $get('Paragraph1').className = styleToSelect;
        }

        // Add click handlers for buttons to show and hide modal popup on pageLoad
        function pageLoad() {
            $addHandler($get("showModalPopupClientButton"), 'click', showModalPopupViaClient);
            $addHandler($get("hideModalPopupViaClientButton"), 'click', hideModalPopupViaClient);
        }

        function showModalPopupViaClient(ev) {
            ev.preventDefault();
            var modalPopupBehavior = $find('programmaticModalPopupBehavior');
            modalPopupBehavior.show();
        }

        function hideModalPopupViaClient(ev) {
            ev.preventDefault();
            var modalPopupBehavior = $find('programmaticModalPopupBehavior');
            modalPopupBehavior.hide();
        }
    </script>
    <div class="demoarea">
        <div class="demoheading">
            </div>
        <p id="Paragraph1">
           
        <br />

            <asp:DropDownList ID="DropDownList2" runat="server">
            </asp:DropDownList>
            
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                SelectMethod="FindAllByCategory" TypeName="DataAccessLayer.ItemFacade">
                <SelectParameters>
                    <asp:ControlParameter ControlID="DropDownList1" DefaultValue="Clip" 
                        Name="categoryID" PropertyName="SelectedValue" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
        <p>
           
        <asp:Button ID="Button1" runat="server" Text="Add Item" />
        <asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to change the paragraph style" />
        <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">
            <asp:Panel ID="Panel3" runat="server" Style="cursor: move; background-color: #DDDDDD;
                border: solid 1px Gray; color: Black">
                <div>
                    <p>
                        Choose the paragraph style you would like:</p>
                </div>
            </asp:Panel>
            <div>
                <p>
                
                    &nbsp;
                 
            
                <asp:Label ID="Label1" runat="server" Text="Select Department"></asp:Label>   
                <asp:DropDownList ID="DropDownList1" runat="server"  onselectedindexchanged="DropDownList2_SelectedIndexChanged" AutoPostBack="true">
                </asp:DropDownList>
                </p>
             
                <p>
                   <asp:GridView ID="GridView1" runat="server" 
                AutoGenerateColumns="False" PageSize="7"  DataSourceID="ObjectDataSource1">
                <Columns>
                    <asp:TemplateField HeaderText="Items">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                            &nbsp;&nbsp;
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
                </p>
                <p>
                   
                </p>
                <p>
                    
                </p>
              
                <p style="text-align: center;">
                    <asp:Button ID="OkButton" runat="server" Text="OK" />
                    <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
                </p>
            
            </div>
        </asp:Panel>
        <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="Button1"
            PopupControlID="Panel1" BackgroundCssClass="modalBackground" OkControlID="OkButton"
            OnOkScript="onOk()" CancelControlID="CancelButton" DropShadow="true" PopupDragHandleControlID="Panel3" />
        <br />
        <br />
        <hr />
        <br />
        
        
    </form>
</body>
</html>
